﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Sita.Presentation.ViewModels.WOModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link rel="stylesheet" href="../../Content/Styles/WOStyle.css" type="text/css" media="screen"
        title="default" />
    <title>Work Order: <%: Model.WorkOrder.Number %></title>
</head>
<body>
    <center>
        <div id="OuterBox">
            <div id="Box">
                <div id="Header">
                    <div id="LeftHeader">
                        <div id="CompanyName">
                            <%: Model.WorkOrder.BusinessUnit.Name %>
                        </div>
                        <div id="CompanyAddress">
                            <%: Model.WorkOrder.BusinessUnit.Address%>
                        </div>
                    </div>
                    <div id="CenterHeader">
                        <img src="../../Content/Images/BUs/BU<%: Model.WorkOrder.BusinessUnit.BusinessUnitID %>_WO.jpg" />
                    </div>
                    <div id="RightHeader">
                        <%: Model.WorkOrder.BusinessUnit.Email%><br />
                        <%: Model.WorkOrder.BusinessUnit.Phone%>
                    </div>
                </div>
                <div id="Info">
                    <div id="LeftInfo">
                        <table style="width: 100%;">
                            <tr>
                                <td style="width: 90px; font-weight: bold;">
                                    Nro. de Orden:
                                </td>
                                <td colspan="3">
                                    <%: Model.WorkOrder.Number %>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 90px; font-weight: bold;">
                                    Fecha Pres:
                                </td>
                                <td colspan="3">
                                    <%: Model.WorkOrder.BeginDate.Day %>/<%: Model.WorkOrder.BeginDate.Month %>/<%: Model.WorkOrder.BeginDate.Year %>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 90px; font-weight: bold;">
                                    ID Vehiculo:
                                </td>
                                <td colspan="3">
                                    <%: Model.WorkOrder.VehicleID %>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 90px; font-weight: bold;">
                                    Tipo:
                                </td>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.VehicleType.Name %>
                                </td>
                                <td style="width: 90px; font-weight: bold;">
                                    Patente:
                                </td>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.LicencePlate %>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 90px; font-weight: bold;">
                                    Marca:
                                </td>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.VehicleBrand.BrandName %>
                                </td>
                                <td style="width: 90px; font-weight: bold;">
                                    Modelo:
                                </td>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.ModelName %>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="RightInfo">
                        <table style="width: 70%; float: right;">
                            <tr>
                                <td style="width: 90px; font-weight: bold;">
                                    Nro. Cliente: <span style="font-weight: normal;">
                                        <%: Model.WorkOrder.Vehicle.CustomerID %></span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.Customer.FirstName %>&nbsp;<%: Model.WorkOrder.Vehicle.Customer.LastName %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.Customer.Address %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.Customer.Email %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <%: Model.WorkOrder.Vehicle.Customer.Phone %>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div id="Details">
                    <table style="width: 100%;">
                        <thead style="border-bottom: 1px solid black; border-top: 1px solid black">
                            <tr>
                                <td colspan="4">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    Código
                                </th>
                                <th>
                                    Cantidad
                                </th>
                                <th>
                                    Referencia
                                </th>
                                <th>
                                    Importe
                                </th>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    &nbsp;
                                </td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="4">
                                    &nbsp;
                                </td>
                            </tr>
                            <%--REPLACEMENTS--%>
                            <% foreach (Sita.Entities.WorkOrderReplacement replacement in Model.WorkOrder.WorkOrderReplacements)
                               { %>
                            <tr>
                                <td>
                                    <%:replacement.Replacement.Code %>
                                </td>
                                <td>
                                    <%:replacement.Quantity %>
                                </td>
                                <td>
                                    <%:replacement.Replacement.Name %>
                                </td>
                                <td>
                                    <%:replacement.Price %>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    &nbsp;
                                </td>
                            </tr>
                            <%} %>
                            <%--HAND WORK--%>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    Mano de Obra
                                </td>
                                <td>
                                    <%:Model.HandWorkPrice %>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    &nbsp;
                                </td>
                            </tr>
                        </tbody>
                        <tfoot style="border-top: 1px solid black; font-weight: bold;">
                            <tr>
                                <td colspan="4" align="left">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;
                                </td>
                                <td style="text-align: right;">
                                    Total
                                </td>
                                <td>
                                    <%:Model.TotalPrice %>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </center>
</body>
</html>
